﻿
GY.Bill.Member = {
    GetMemberModel: function () {
        var model = {
            Id: $("#hidId").val(),
            Name: $("#txtName").val(),
            CompanyName: $("#txtCompanyName").val(),
            Mobile: $("#txtMobile").val()
        }
        return model;
    },
    //保存票据
    SaveMember: function () {
        var returnUrl = $("#divMain").attr("data-returnurl");
        $.ajax({
            type: "Post",
            url: $("#divMain").attr("data-url"),
            data: GY.Bill.Member.GetMemberModel(),
            success: function (result) {
                location.href = returnUrl;
            }
        });
    }
};

(function () {
    $(function () {
        //保存
        $("#BtnSave").on("click", function () {

            var msg = GY.Bill.Common.ValidDataResult();
            if (msg == "") {
                GY.Bill.Member.SaveMember();
            }
            else {
                ShowTip(msg);
                return;
            }
        });

        $("#menuMember").addClass("active");
    });
})();

